﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Collections.Generic;
#pragma warning disable 0618
namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for dotHTML.HTML.ObjectTest and is intended
    ///to contain all dotHTML.HTML.ObjectTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ObjectTest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for dotHTML.HTML.Object Constructor
        ///</summary>
        [TestMethod()]
        public void ObjectConstructorTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            Assert.AreEqual("<object></object>", target.ToString());
        }

        /// <summary>
        ///A test for Archive
        ///</summary>
        [TestMethod()]
        public void ArchiveTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            target.Archive.Add("ac1");
            target.Archive.Add("ac2");
            Assert.IsTrue(target.Archive.Count == 2);
            Assert.IsTrue(target.Archive.Contains("ac1"));
            Assert.IsTrue(target.Archive.Contains("ac2"));
        }

        /// <summary>
        ///A test for Border
        ///</summary>
        [TestMethod()]
        public void BorderTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.Border = expected;
            actual = target.Border;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for ClassID
        ///</summary>
        [TestMethod()]
        public void ClassIDTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            string expected = string.Empty;
            string actual;
            target.ClassID = expected;
            actual = target.ClassID;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for CodeType
        ///</summary>
        [TestMethod()]
        public void CodeTypeTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            string expected = string.Empty;
            string actual;
            target.CodeType = expected;
            actual = target.CodeType;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Codebase
        ///</summary>
        [TestMethod()]
        public void CodebaseTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            string expected = string.Empty;
            string actual;
            target.CodeBase = expected;
            actual = target.CodeBase;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Data
        ///</summary>
        [TestMethod()]
        public void DataTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            string expected = string.Empty;
            string actual;
            target.Data = expected;
            actual = target.Data;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Declare
        ///</summary>
        [TestMethod()]
        public void DeclareTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            bool expected = false;
            bool actual;
            target.Declare = expected;
            actual = target.Declare;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Form
        ///</summary>
        [TestMethod()]
        public void FormTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            Form expected = new Form();
            Form actual;
            target.Form = expected;
            actual = target.Form;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Height
        ///</summary>
        [TestMethod()]
        public void HeightTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.Height = expected;
            actual = target.Height;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            string expected = string.Empty;
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Standby
        ///</summary>
        [TestMethod()]
        public void StandbyTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            string expected = string.Empty;
            string actual;
            target.Standby = expected;
            actual = target.Standby;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Type
        ///</summary>
        [TestMethod()]
        public void TypeTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            string expected = string.Empty;
            string actual;
            target.Type = expected;
            actual = target.Type;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for UseMap
        ///</summary>
        [TestMethod()]
        public void UseMapTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            Map expected = new Map("name");
            Map actual;
            target.UseMap = expected;
            actual = target.UseMap;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Width
        ///</summary>
        [TestMethod()]
        public void WidthTest() {
            dotHTML.HTML.Object target = new dotHTML.HTML.Object();
            Nullable<int> expected = 1;
            Nullable<int> actual;
            target.Width = expected;
            actual = target.Width;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            dotHTML.HTML.Object o = new dotHTML.HTML.Object();
            o.Archive.Add("ac1");
            o.Archive.Add("ac2");
            o.Border = 1;
            o.ClassID = "classid";
            o.CodeBase = "codebase";
            o.CodeType = "codetype";
            o.Data = "data";
            o.Declare = true;
            Form f = new Form();
            f.ID = "formid";
            o.Form = f;
            o.Height = 2;
            o.Name = "name";
            o.Standby = "standby";
            o.Type = "type";
            Map m = new Map("map");
            m.ID = "mapid";
            o.UseMap = m;
            o.Width = 3;
            Assert.AreEqual("<object archive=\"ac1 ac2 \" " +
                "border=\"1\" " +
                "classid=\"classid\" " +
                "codebase=\"codebase\" " +
                "codetype=\"codetype\" " +
                "data=\"data\" " +
                "declare=\"declare\" " +
                "form=\"formid\" " +
                "height=\"2\" " +
                "name=\"name\" " +
                "standby=\"standby\" " +
                "type=\"type\" " +
                "usemap=\"#mapid\" " +
                "width=\"3\"></object>", o.ToString());
        }
    }
}
